<!--
 * @FilePath     : /study_code/layui/6-4-20.html
 * @Description  : zIndex 层叠顺序
 * @Date         : 2025-04-08 17:33:58
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 08:37:57
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <button id="btn1">按钮1</button>
    <button id="btn2">按钮2</button>
    <button id="btn3">按钮3</button>

    <script src="/layui/dist/layui.js"></script>
    <script>
      // type参数
      layui.use('layer', function () {
        var layer = layui.layer,
          $ = layui.$

        /**
         * @brief: 设置弹出层 - 层叠顺序
         * !实际渲染的值会比设置的只大1 （渲染后的层叠顺序见 ./images/ 下的图）
         * @value {number}
         */

        $('#btn1').on('click', function () {
          layer.open({
            type: 0,
            content: '<div>文字信息111</div>',
            zIndex: 1212,
          })
        })

        $('#btn2').on('click', function () {
          layer.open({
            type: 0,
            content: '<div>文字信息22</div>',
            zIndex: 2212,
          })
        })

        $('#btn3').on('click', function () {
          layer.open({
            type: 0,
            content: '<div>文字信息333</div>',
            zIndex: 3212,
          })
        })
      })
    </script>
  </body>
</html>
